/-boot
/-docs
/-editor
/-files
/-files-old
/-imports
/-layout
/-shell
/-storage
/-tests
/-typings
Dom.ts
TypeScriptService.ts
functions.ts
ko.ts
nteapo.html
persistence.api.ts
persistence.ts
shell.ts
teapo.html
teapo.ts
tmp.ts
try.html
try.js
​x
1
var _errorCache = [];
2
_errorCache.byText = {};
3
​
4
window.onerror = function(errObj, file, line, ch, err) {
5
  var txt = err.stack;
6
  var firstTrigger = _errorCache.length === 0;
7
  if (_errorCache.byText[txt]) {
8
    _errorCache.byText[txt]++;
9
  }
10
  else {
11
    _errorCache.byText[txt]=1;
12
    _errorCache.push(txt);
13
  }
14
​
15
  if (firstTrigger)
16
    setTimeout(function() {
17
      var errorText = _errorCache.map(function(txt){return _errorCache.byText[txt]+' - '+txt}).join('\n');
18
      _errorCache = [];
19
      _errorCache.byText = {};
20
      alert(errorText);
21
    }, 200);
22
};
23
​
24
throw new Error('123')
Updated 2014-9-23 16:15.